package com.example.mobiledatapackage.mapper;

import com.example.mobiledatapackage.domain.pojo.PackageRecommendQueryCondDto;
import com.example.mobiledatapackage.request.pkg.PackageCondition;
import org.apache.ibatis.annotations.Mapper;
import com.example.mobiledatapackage.domain.Package;
import java.util.List;

@Mapper
public interface PackageMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(String id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(Package record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(Package record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    Package selectByPrimaryKey(String id);

    /**
     * select all
     */
    List<Package> selectAll();

    /**
     * 根据各字段的范围下限来寻找相应的套餐
     */
    List<Package> recommendQueryByCondition(PackageRecommendQueryCondDto cond);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Package record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Package record);

    List<Package> selectConditional(PackageCondition cond);
}